import '@/assets/main.css'

import { createApp } from 'vue'
import App from '@/App.vue'
// 导入路由
import router from '@/router'

// 导入 Element Plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { ElInfiniteScroll } from 'element-plus'

// 导入 Element Plus Icons 并全局注册
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

// 全局注册所有图标组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 应用 Element Plus
app.use(ElementPlus)

// 全局注册无限滚动指令
app.directive('infinite-scroll', ElInfiniteScroll)

// 应用路由
app.use(router)
app.mount('#app')
